import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
function _resolve(dir: string) {
  return path.resolve(__dirname, dir);
}
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  // 支持 less 样式
  css: {
    preprocessorOptions: {
      less: {
        modifyVars: {
          'primary-color': '#FF6923',
          hack: `true; @import (reference) "${path.resolve('src/assets/css/atom.less')}"`,
        },
        javascriptEnabled: true,
      },
    },
  },
  resolve: {
    alias: {
      '@': _resolve('src'),
      '@v': _resolve('src/views'),
      '@c': _resolve('src/components'),
      '@a': _resolve('src/assets'),
      '@i': _resolve('src/assets/imgs'),
      '@u': _resolve('src/utils'),
      '@r': _resolve('src/request'),
      '@g': _resolve('src/globalInfo')
    }
  },
  build: {
    outDir: 'haimai'
  }
})
